package com.ptit.piclient.model;


public class Song {
	String name;
	String [] artist;
	String album;
	String thumbnail;
	int duration, songid;
	public Song(){}
	public String toString(){		
		return name;
	}
	public String getName() {
		return name;
	}
        public void show(){
            System.out.println("--------------------------------");
            if(name == null || name.equals("")) name = "Untitled";
            if(album == null || album.equals("")) album = "Unknown";
            System.out.println("Name: "+ name);
            System.out.println("Album: " + album);
            System.out.println("Duration: " + formatDuration());
        }
        public String formatDuration(){
            String ret = "";
            ret += (duration / 60) + ":";
            ret += duration % 60;
            return ret;
        }
	public void setName(String name) {
		this.name = name;
	}
	public String [] getArtist() {
		return artist;
	}
	public void setArtist(String [] artist) {
		this.artist = artist;
	}
	public String getAlbum() {
		return album;
	}
	public void setAlbum(String album) {
		this.album = album;
	}
	public String getThumbnail() {
		return thumbnail;
	}
	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}
	public int getDuration() {
		return duration;
	}
	public String getFormatedDuration(){
		String ret = "";
		ret += (duration / 60);
		ret += ":";
		int du = duration % 60;
		if(du < 10) ret += "0";
		ret += du;
		return ret;
		
	}
	public void setDuration(int duration) {
		this.duration = duration;
	}
	public int getSongid() {
		return songid;
	}
	public void setSongid(int songid) {
		this.songid = songid;
	}
	
}
